package com.vrv.netmgr.alarm;

import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;

import com.vrv.common.resolver.RequestParameter;
import com.vrv.common.view.CommonFormActivity;
import com.vrv.netmgr.R;

public class EquipmentChangedFormActivity extends CommonFormActivity {

    private EditText ipaddressVal = null;
    private EditText errorMsgVal = null;
    private Button searchBtn = null;

    @Override
    protected View getActionView() {
        return searchBtn;
    }

    @Override
    protected RequestParameter getRequestParameterInstance() {
        RequestParameter parameter = new RequestParameter("errorMessage/jsonList.do");
        parameter.addArgs("errorType", 1);
        parameter.addArgs("errorMsg", errorMsgVal.getText().toString());
        parameter.addArgs("ipaddress", ipaddressVal.getText().toString());
        return parameter;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        
        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        setContentView(R.layout.equipment_change_form_layout);
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.common_title);
        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

        ipaddressVal = (EditText) findViewById(R.id.ipaddresVal);
        errorMsgVal = (EditText) findViewById(R.id.errorMsgVal);
        searchBtn = (Button) findViewById(R.id.searchBtn);

        TextView title = (TextView) findViewById(R.id.title_text);
        title.setText("设备变化");
        ImageButton backBtn = (ImageButton) findViewById(R.id.backBtn);
        backBtn.setVisibility(View.VISIBLE);
        backBtn.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
    }

    @Override
    protected void prepareData(Bundle savedInstanceState) {
        detailKeys = new String[] { "deptName", "officeName", "userName", "tel", "ipaddress", "deviceName", "ipaddress1", "errorMsg", "sysUserName", "errorTime", "macAddress", "lookFlag" };
        listKeys = new String[] { "ipaddress", "deviceName", "userName" };
        caption = "设备变化";
    }

}
